<?php
	require_once('./oauth.php');

	session_start();
	if(!isset($_SESSION['oauth_token_secret']))//session丢失
	{
		$error='LOST: oauth_token_secret';
		FailPage($error);
	}
	else if(isset($_GET['denied']))//denied
	{
		$error='Denide: user does NOT allow this application access';
		FailPage($error);
	}
	else if(isset($_GET['oauth_token'], $_GET['oauth_verifier']))//allowed
	{
		$callback['oauth_token']=$_GET['oauth_token'];
		$callback['oauth_token_secret']=$_SESSION['oauth_token_secret'];
		$callback['oauth_verifier']=$_GET['oauth_verifier'];

		OAuth_2($callback);
	}
	else
	{
		$error='LOST: oauth_token OR oauth_verifier';
		FailPage($error);
	}
?>